<html>
<head><meta charset="utf-8"><title>workspace internal vs external crate conflicts · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/workspace.20internal.20vs.20external.20crate.20conflicts.html">workspace internal vs external crate conflicts</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="219372033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/workspace%20internal%20vs%20external%20crate%20conflicts/near/219372033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/workspace.20internal.20vs.20external.20crate.20conflicts.html#219372033">(Dec 09 2020 at 17:49)</a>:</h4>
<p>Hi, </p>
<p>I was playing around with Cargo and was wondering why the following cargo.toml compiles fine:</p>
<div class="codehilite"><pre><span></span><code>[dependencies]
serde = &quot;1.0&quot;
serde2 = { package = &quot;serde&quot;, path = &quot;../serde&quot;}
</code></pre></div>
<p>But I seem to be having trouble with this compiling:</p>
<div class="codehilite"><pre><span></span><code>[dependencies]
serde = &quot;1.0&quot;
serde2 = { path = &quot;../serde&quot;}
</code></pre></div>
<p>?</p>



<a name="219372114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/workspace%20internal%20vs%20external%20crate%20conflicts/near/219372114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/workspace.20internal.20vs.20external.20crate.20conflicts.html#219372114">(Dec 09 2020 at 17:49)</a>:</h4>
<p>In the second case a package names <code>serde2</code> is expected, but it is called <code>serde</code>.</p>



<a name="219372275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/workspace%20internal%20vs%20external%20crate%20conflicts/near/219372275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/workspace.20internal.20vs.20external.20crate.20conflicts.html#219372275">(Dec 09 2020 at 17:50)</a>:</h4>
<p>That makes sense. Do you know why the first case compiles? I thought it would not since I made the package name to serde</p>



<a name="219372368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/workspace%20internal%20vs%20external%20crate%20conflicts/near/219372368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/workspace.20internal.20vs.20external.20crate.20conflicts.html#219372368">(Dec 09 2020 at 17:51)</a>:</h4>
<p>The first case you are using the dependency renaming feature. It will expect a package called <code>serde</code>, but then tell rustc to treat it as if it was called <code>serde2</code> when compiling the current crate.</p>



<a name="219372833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/workspace%20internal%20vs%20external%20crate%20conflicts/near/219372833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/workspace.20internal.20vs.20external.20crate.20conflicts.html#219372833">(Dec 09 2020 at 17:55)</a>:</h4>
<p>Oh I see, I was completely misunderstanding the feature. Thank you for correcting me</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>